home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / •New Files / tmr 8 small / tmr 8 small.rsrc / TEXT_3300_• vgc.cpp.txt < prev    next >
Text File  |  2000-01-09  |  3KB  |  78 lines

  1. //Virtual Ghetto Craps
  2. //vgc.cpp
  3. //dah h1tman [murdah]
  4.  
  5. #include <iostream.h>
  6. #include <stdlib.h>
  7. #include <time.h>
  8.  
  9. int rollDice(void);
  10. int intro(void);
  11. main()
  12. {
  13.         intro();
  14.         enum Status { kContinue, kWon, kLost };
  15.         int sum,myPoint;
  16.         Status gameStatus;
  17.         
  18.         srand(time(NULL));
  19.         sum = rollDice();
  20.         
  21.         switch(sum) {
  22.                 case 7: case 11:
  23.                         gameStatus = kWon;
  24.                         break;
  25.                 case 2: case 3: case 12:
  26.                         gameStatus = kLost;
  27.                         break;
  28.                 default:
  29.                         gameStatus = kContinue;
  30.                         myPoint = sum;
  31.                         cout<<"Point is " << myPoint << endl;
  32.                         break;
  33.                 }
  34.                 
  35.                 while (gameStatus == kContinue) {
  36.                         sum = rollDice();
  37.                         
  38.                         if (sum == myPoint)
  39.                                 gameStatus = kWon;
  40.                         else
  41.                                 if (sum == 7)
  42.                                         gameStatus = kLost;
  43.                 }
  44.         
  45.                 if (gameStatus == kWon)
  46.                         cout<<"jo0 win m0f0" << endl;
  47.                 else
  48.                         cout<<"jo0 l0se wh1t3 boi" << endl;
  49.                         
  50.                         return 0;
  51.                 }
  52.         
  53.         
  54.         int rollDice(void)
  55.                 {
  56.                         int die1, die2, worksum;
  57.                         
  58.                         die1 = 1 + rand() % 6;
  59.                         die2 = 1 + rand() % 6;
  60.                         worksum = die1 + die2;
  61.                         cout<<"player rolled " << die1 << "+" << die2 << " " << worksum << endl;
  62.                         
  63.                         return worksum;
  64.                 }
  65.                 
  66.                 
  67.         int intro(void)
  68.                 {
  69.                         cout<<" you walk out of the local corner store with a 40oz in a bag(h0w 80s)."<<endl
  70.                         <<" jo0 see some of the local gangbangers big smally,bubba and wang g thang playing craps."<<endl
  71.                         <<" You go ooo i can do that,sorta like monopoly. You walk your ghetto walk and"<<endl
  72.                         <<" speak in your best ebonics, ay yo, lemme get in dis yo. i can beat all yaw fewls"<<endl
  73.                         <<" they look at you,like who is dis white dude?stick to water polo. But you whine" <<endl
  74.                         <<" and plead and finally they let you play! Now show your stuff in....."<<endl;
  75.                         cout<<"\nVirtual Ghetto Craps@#&%&\n\n";
  76.                 }
  77.         
  78.